import instance from '@/utils/request';

/**
 * 添加父级分类
 * @param {} data 
 * @returns 
 */
export const firstCategoryAdd = (data = {}) => {
  return instance.request({
    method: "post",
    url: "/news/addFirstCategory/",
    data
  })
}
/**
 * 获取分类
 * @param {*} data 
 * @returns 
 */
export const GetCategory = (data = {}) => {
  return instance.request({
    method: "post",
    url: "/news/getCategoryAll/",
    data
  })
}

/** 子级分类添加 */
export const ChildCategoryAdd = (data = {}) => {
  return instance.request({
    method: "post",
    url: "/news/addChildrenCategory/",
    data
  })
}

/** 分类编辑 */
export const CategoryEdit = (data = {}) => {
  return instance.request({
    method: "post",
    url: "/news/editCategory/",
    data
  })
}

/** 分类删除 */
export const CategoryDel = (data = {}) => {
  return instance.request({
    method: "post",
    url: "/news/deleteCategory/",
    data
  })
}


/** 添加信息 */
export const InfoCreate = (data = {}) => {
  return instance.request({
    method: "post",
    url: "/news/add/",
    data
  })
}

/** 获取列表 */
export const GetTableList = (data = {}) => {
  return instance.request({
    method: "post",
    url: "/news/getList/",
    data
  })
}

/** 发布状态 */
export const Status = (data = {}) => {
  return instance.request({
    method: "post",
    url: "/news/status/",
    data
  })
}

/** 删除 */
export const Delete = (data = {}) => {
  return instance.request({
    method: "post",
    url: "/news/delete/",
    data
  })
}

/** 获取详情 */
export const GetDetailed = (data = {}) => {
  return instance.request({
    method: "get",
    url: "/news/detailed/",
    params: data
  })
}


/** 信息修改 */
export const InfoEdit = (data = {}) => {
  return instance.request({
    method: "post",
    url: "/news/editInfo/",
    data
  })
}
